home *** CD-ROM | disk | FTP | other *** search
- {*********************************************}
- {* *}
- {* Designer (C) Ian OConnor 1994 *}
- {* *}
- {* Designer Produced Pascal Unit *}
- {* *}
- {*********************************************}
-
- {* Re-edited by Nicolai Jensen May-17-1995 *}
-
- Unit Paus;
-
- Interface
-
- Uses exec,locale, utility;
-
-
- Function OpenLibs:Boolean;
- Procedure CloseLibs;
- Procedure Settagitem( pt : ptagitem ; tag : long ; data : long);
- function GetString( id : long ):string;
- function GetStringptr( id : long ):pbyte;
- procedure OpenPauseCatalog(loc : pLocale ;lang : pbyte);
- Procedure ClosePauseCatalog;
-
-
- const
-
- Pause_BuiltInLanguage : string[8] = 'english'#0;
- Pause_CatName : string[14] = 'Pause.catalog'#0;
-
- PauseText = 0;
-
- ProgramStrings : array[0..1] of string[34] =
- (
- 'Pause... hit <ENTER> to continue '#0,
- ''#0
- );
- Var
- Pause_Catalog : pCatalog;
-
- Implementation
-
- Function OpenLibs:Boolean;
- Var
- OkSoFar : Boolean;
- Begin
- OkSoFar:=True;
- localebase:=OpenLibrary( 'locale.library', 38);
- end;
-
- Procedure CloseLibs;
- Begin
- if localebase<>Nil then
- CloseLibrary( PLibrary( localebase));
- end;
-
- Procedure Settagitem( pt : ptagitem ; tag : long ; data : long);
- Begin
- pt^.ti_tag:=tag;
- pt^.ti_data:=data;
- end;
-
-
- function GetString( id : long ):string;
- var
- temp : string;
- p : pbyte;
- begin
- p:=GetStringptr( id );
- ctopas(p^,temp);
- GetString:=temp;
- end;
-
- function GetStringptr( id : long ):pbyte;
- begin
- if Pause_Catalog<>nil then
- GetStringptr:=pbyte(GetCatalogStr(Pause_Catalog, id, STRPTR(@Programstrings[id,1])))
- else
- GetStringptr:=pbyte(@ProgramStrings[id,1]);
- end;
-
- procedure OpenPauseCatalog(loc : pLocale ;lang : pbyte);
- var
- tags : array[1..5] of ttagitem;
- begin
- tags[1].ti_data:=long(lang);
- if lang<>nil then
- tags[1].ti_tag:=$80090004
- else
- tags[1].ti_tag:=tag_ignore;
- settagitem(@tags[2],$80090001,long(@Pause_BuiltInLanguage[1]));
- settagitem(@tags[3],$80090003,1);
- tags[4].ti_tag:=tag_done;
- if (localebase<>nil) and (Pause_Catalog = nil) then
- Pause_Catalog:=OpenCatalogA(loc,@Pause_CatName[1], @tags[1]);
- end;
-
- Procedure ClosePauseCatalog;
- begin
- if localebase<>nil then
- CloseCatalog(Pause_Catalog);
- Pause_Catalog:=nil;
- end;
-
- Begin
- Pause_Catalog:=nil;
- LocaleBase:=nil;
- End.
-